package com.shop.mapper;

import com.shop.pojo.Brand;
import com.shop.pojo.Good;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface BrandMapper {
    @Insert("insert into ptable values(#{pid},#{pname},#{pimgurl})")
    public int save(Brand brand) throws Exception;
    @Select("select * from ptable where pname like \"%\"#{queryInfo}\"%\"")
    public List<Brand> selectBrand(String queryInfo);
    @Delete("delete from ptable where pid = #{pid}")
    public int deleteBrand(int pid);
    @Update("update ptable set pname = #{pname}, pimgurl = #{pimgurl} where pid = #{pid}")
    public int updateBrand(Brand brand);
    @Select("select * from ptable")
    public List<Brand> selectAll();
    @Select("select count(*) from ptable")
    public Integer selectCount();
    @Select("select * from ptable where pid = #{pid}")
    public Brand selectById(int pid);
}
